package org.gd.hellojson.locale;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonSetter;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.io.Serializable;

/**
 * @author Gorhover
 * @version 1.0-SNAPSHOT
 * @since 2013-11-07 18:18
 */
@JsonAutoDetect
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
class User implements Serializable {

    private Integer id;
    private String name;

    @JsonProperty("id")
    Integer getId() {
        //System.out.println("getId(): " + id);
        return id;
    }

    @JsonSetter("id")
    void setId(Integer id) {
        //System.out.println("setId(): " + id);
        this.id = id;
    }

    @JsonProperty("name")
    @JsonSerialize(using = JS.class,
            include = JsonSerialize.Inclusion.NON_NULL)
    String getName() {
        //System.out.println("getName(): " + name);
        return name;
    }

    @JsonSetter("name")
    void setName(String name) {
        //System.out.println("setName(): " + name);
        this.name = name;
    }
}
